Current Location: Home> Function Categories> mktime

mktime

Get a Unix timestamp for a date
Name:mktime
Category:Date and time
Programming Language:php
One-line Description:Returns the Unix timestamp of the date.

Definition and usage

gmmktime() function returns the UNIX timestamp of the date.

Tip: This function is the same as gmmktime() , except that the passed parameter represents the date (not the GMT date).

Example

Returns a UNIX timestamp of a date. Then use it to find the days of that date:

 <?php
// Output: October 3, 1975 was on a Friday
echo "Oct 3, 1975 was on a " . date ( "l" , mktime ( 0 , 0 , 0 , 10 , 3 , 1975 ) ) ;
?>

Try it yourself

Similar Functions
Popular Articles